home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / graphics / viewers / svgamp-1.000 < prev    next >
Text File  |  1996-11-16  |  4KB  |  190 lines

  1. Hello all,
  2.  
  3.     This patch lets vgamp v1.0 work with svgalib. I use 80x50 console and 
  4. vgamp would mess things up on exit. Using svgalib fixes this problem.
  5. Thanks Gwoho for this nifty mpeg player.
  6.  
  7.     Have fun,
  8.  
  9.         James Klicman <james@ccnet.com>
  10.  
  11.  
  12.  
  13.  
  14.  
  15. diff -c vgamp/Makefile svgamp/Makefile
  16. *** vgamp/Makefile    Wed May  4 16:39:01 1994
  17. --- svgamp/Makefile    Sun Jan 15 11:26:17 1995
  18. ***************
  19. *** 1,17 ****
  20. ! CFLAGS = -O -fomit-frame-pointer -pipe -m486
  21.   LDFLAGS = -s -N
  22. ! AFLAGS = -DADJUST=2 -DCPU_NUMBER=3 -DDCT_EIGHT
  23.   
  24.   .SUFFIXES: .S .o .c .h
  25.   
  26.   .S.o:
  27. !     cpp $(AFLAGS) $< | as -o $@ -
  28.   
  29.   OBJS = asm_stuff.o util.o video.o parseblock.o decoders.o main.o \
  30.       recon.o dither.o asmrevdct.o output.o hw.o
  31.   
  32.   vgamp: $(OBJS)
  33. !     cc $(LDFLAGS) $(OBJS) -o vgamp
  34.   
  35.   asmrevdct.o: asmrevdct.S dct.S dct_const.h
  36.   
  37. --- 1,17 ----
  38. ! CFLAGS = -O -fomit-frame-pointer -pipe -m486 -D_USE_SVGALIB_
  39.   LDFLAGS = -s -N
  40. ! AFLAGS = -DADJUST=2 -DCPU_NUMBER=4 -DDCT_EIGHT
  41.   
  42.   .SUFFIXES: .S .o .c .h
  43.   
  44.   .S.o:
  45. !     /lib/cpp $(AFLAGS) $< | as -o $@ -
  46.   
  47.   OBJS = asm_stuff.o util.o video.o parseblock.o decoders.o main.o \
  48.       recon.o dither.o asmrevdct.o output.o hw.o
  49.   
  50.   vgamp: $(OBJS)
  51. !     cc $(LDFLAGS) $(OBJS) -o vgamp -lvga
  52.   
  53.   asmrevdct.o: asmrevdct.S dct.S dct_const.h
  54.   
  55. diff -c vgamp/README svgamp/README
  56. *** vgamp/README    Wed May  4 16:39:01 1994
  57. --- svgamp/README    Sun Jan 15 20:39:45 1995
  58. ***************
  59. *** 28,36 ****
  60. --- 28,45 ----
  61.   Specifying none of the above will cause vgamp to output color ordinary size.
  62.   
  63.   
  64. + #ifdef _USE_SVGALIB_
  65. + Works with svga, wacky console modes etc...
  66. + #else
  67.   This program doesn't know anything about SVGA.  If you use wacky cosole
  68.   like 132x40 or such, this program probably will not work--it doesn't know about
  69.   the wacky SVGA mode.  Use 80x25 console.
  70. + #endif
  71.   
  72.   
  73.   Before you complain that the output looks lousy, please keep the following
  74. diff -c vgamp/hw.c svgamp/hw.c
  75. *** vgamp/hw.c    Wed May  4 16:39:00 1994
  76. --- svgamp/hw.c    Sun Jan 15 20:19:38 1995
  77. ***************
  78. *** 6,11 ****
  79. --- 6,15 ----
  80.   #include <signal.h>
  81.   #include <asm/io.h>
  82.   
  83. + #ifdef _USE_SVGALIB_
  84. + #include <vga.h>
  85. + #endif
  86.   #define VGABASE        0x3d4
  87.   
  88.   static struct regs {
  89. ***************
  90. *** 166,179 ****
  91.   void
  92.   eexit()
  93.   {
  94.       text_mode();
  95.       _exit(0);
  96.   }
  97.   
  98.   get_rid_of_root()
  99.   {
  100.       int i;
  101.       if ((i = open("/dev/mem",2)) < 0) {
  102.           write_2("can't open /dev/mem\n");
  103.           _exit(1);
  104. --- 170,186 ----
  105.   void
  106.   eexit()
  107.   {
  108. + #ifdef _USE_SVGALIB_
  109. +     vga_setmode(TEXT);
  110. + #else
  111.       text_mode();
  112. + #endif
  113.       _exit(0);
  114.   }
  115.   
  116.   get_rid_of_root()
  117.   {
  118.       int i;
  119.       if ((i = open("/dev/mem",2)) < 0) {
  120.           write_2("can't open /dev/mem\n");
  121.           _exit(1);
  122. diff -c vgamp/main.c svgamp/main.c
  123. *** vgamp/main.c    Wed May  4 16:39:00 1994
  124. --- svgamp/main.c    Sun Jan 15 20:22:20 1995
  125. ***************
  126. *** 16,22 ****
  127. --- 16,26 ----
  128.   {
  129.       int i,j;
  130.   
  131. + #ifdef _USE_SVGALIB_
  132. +     vga_init();
  133. + #else
  134.       get_rid_of_root();
  135. + #endif
  136.       for (i=1; i<argc; i++)
  137.           if (*argv[i] == '-') {
  138.               if (strcmp(argv[i],"--") == 0) {
  139. diff -c vgamp/output.c svgamp/output.c
  140. *** vgamp/output.c    Wed May  4 16:39:00 1994
  141. --- svgamp/output.c    Sun Jan 15 20:21:14 1995
  142. ***************
  143. *** 6,11 ****
  144. --- 6,15 ----
  145.   #include <sys/types.h>
  146.   #include <sys/timeb.h>
  147.   
  148. + #ifdef _USE_SVGALIB_
  149. + #include <vga.h>
  150. + #endif
  151.   extern mb_width,width,height,mod_y,mod_c,gray,frames;
  152.   extern struct pict_image *current;
  153.   extern char *vram;
  154. ***************
  155. *** 43,49 ****
  156. --- 47,61 ----
  157.               pal[(i+128)*3+1] = C_CONV(-j*0.34414);
  158.               pal[(i+128)*3+2] = C_CONV(j*1.77200);
  159.           }
  160. + #ifdef _USE_SVGALIB_
  161. +     vga_setmode(G320x200x256);
  162. +     for (i=0; i<256; i++) {
  163. +         vga_setpalette(i,pal[i*3]>>2,pal[i*3+1]>>2,pal[i*3+2]>>2);
  164. +     }
  165. +     vram = graph_mem;
  166. + #else
  167.       graph_mode(pal);
  168. + #endif
  169.       ftime(&start);
  170.   }
  171.   
  172. ***************
  173. *** 56,61 ****
  174. --- 68,74 ----
  175.       if (gray) {
  176.           hs = width>320 ? 320 : width;
  177.           vs = height>200 ? 200 : height;
  178.           a = vram;
  179.           b = current->lum;
  180.           do {
  181.